package com.ruoyi.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum TrainStatus {
  FINISHED("finished"),
  TRAINING("training"),
  WAIT("wait"),
  FAILED("failed");

  private final String status;

  public String getStatus() {
      return status;
  }

  public static TrainStatus fromStatus(String status) {
      for (TrainStatus ts : TrainStatus.values()) {
          if (ts.status.equalsIgnoreCase(status)) {
              return ts;
          }
      }
      return null;
  }
}